function res = polinom_mult(p_d, p, q_d, q)

p = [p zeros(1, q_d)];
q = [q zeros(1, p_d)];


res = ifft( fft(p) .* fft(q));

fprintf('Result:\n');
fprintf('%g + ', res(1));

for i = 2:length(res)-1
    fprintf('%gx^%d + ', res(i), i-1);
end
i = length(res);
fprintf('%gx^%d', res(i), i-1);

fprintf('\n');